package com.code.remote.serialization;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;

/**
 * @author lyf
 * @date 2021-10-07 18:09
 */
public class Client {

    public static void main(String[] args) throws Exception {

        Socket socket = new Socket("localhost", 8080);

        User user = new User();
        user.setName("lyf");
        user.setAge(27);

        ObjectOutputStream objectOutputStream = new ObjectOutputStream(socket.getOutputStream());
        objectOutputStream.writeObject(user);

        socket.close();
    }
}
